//
//  CommClass.h
//  KingProFrame
//
//  Created by JinLiang on 15/8/5.
//  Copyright (c) 2015年 king. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CommonCrypto/CommonDigest.h>

@interface CommClass : NSObject

@property (nonatomic, retain) NSMutableDictionary *data;
//单例对外方法
+ (CommClass *)sharedCommon;

//内存数据的存取、移除
- (void)setObject:(id)aObject forKey:(id)aKey;
- (id)objectForKey:(id)aKey;
-(void)removeObjectForKey:(id)aKey;
//本地数据的存取
- (void)localObject:(id)aObject forKey:(id)aKey;

- (id)localObjectForKey:(id)aKey;
- (void)removeLocalObjectForKey:(id)akey;
/**是否第一次运行*/
-(BOOL)isFirstLoad;
/**时间转换成时间字符串 timeFormat是要转换成的时间格式*/
+(NSString*)formatTimeStamp:(NSDate *)timeDate timeFormat:(NSString *)timeFormat;
/**时间字符串转换成时间 timeFormat是要转换成的时间格式*/
+(NSDate*)dateFormatTimeStamp:(NSString *)timeString timeFormat:(NSString *)timeFormat;
//弹出alertView
+ (void)postAlertViewControllerWithTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitle:(NSString *)otherButtonTitle cancelEvent:(void (^)())cancelBlock otherEvent:(void (^)())otherBlock viewController:(id)viewController;
/**获取IP*/
+ (NSString *)getIPStr;
/**获取端口号*/
+ (NSString *)getPortStr;
/**过去服务器地址*/
+ (NSString *)getServerURL;
/**获得UUID*/
+ (NSString *)getUuidWithKeyChain;
/*根据秒获得时分秒*/
+ (NSString *)getMMSSFromSS:(NSString *)totalTime;
/**
 * 拼接时间标题 向下的箭头拼接在文本后面 形成富文本
 * titlestr 标题文本
 * imgName 图片名称
 * y 图片的坐标
 */
+(NSAttributedString *)getTitleStr:(NSString *)titlestr withImgName:(NSString *)imgName withImgY:(float)y;
//权限
+ (RolePower)getRolePowerWith:(NSString *)powerStr;
/**
 上拉加载方法
 
 @param tableView    列表
 @param refreshblock 刷新的方法
 
 @return MJRefreshFooter
 */
+ (MJRefreshFooter *)setUpFooterRefresh:(id)tableView withBlock:(MJRefreshComponentRefreshingBlock)refreshblock;


/**
 返回今日时间

 @return 2017-07-13
 */
+ (NSString *)getTodayDateStr;
/**
 * 功能：去除字符串左右两边的字符
 * message  被剪切的字符串
 * subString 要剪切的字符
 */
+(NSString*)subBeforAndAfterChar:(NSString *)message WithSubChar:(NSString *)subString;
@end
